package com.ruoyi.system.V2.goodInfo.service;

import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.system.V2.goodInfo.domain.ExportJYMGoods;
import com.ruoyi.system.model.domain.GoodsInfo;
import com.ruoyi.system.model.dto.GoodReq;
import com.ruoyi.system.model.dto.GoodsInfoAndAttrValueDto;
import com.ruoyi.system.model.dto.GoodsInfoAndAttrValueReq;
import com.ruoyi.system.model.vo.DeleteAllVo;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * goodsService接口
 *
 * @author ruoyi
 * @date 2023-04-06
 */
public interface IGoodsInfoService {
    /**
     * 查询goods
     *
     * @param id goods主键
     * @return goods
     */
    public GoodsInfo selectGoodsInfoById(Long id);

    /**
     * 查询goods列表
     *
     * @param goodsInfo goods
     * @return goods集合
     */
    public List<GoodsInfo> selectGoodsInfoList(GoodsInfo goodsInfo);

    /**
     * 新增goods
     *
     * @param goodsInfo goods
     * @return 结果
     */
    public int insertGoodsInfo(GoodsInfo goodsInfo);

    public void bacthAddPrice(List<GoodsInfo> goodsInfos, List<SysUser> sysUserList);

    /**
     * 修改goods
     *
     * @param goodsInfo goods
     * @return 结果
     */
    public int updateGoodsInfo(GoodsInfo goodsInfo);

    /**
     * 批量删除goods
     *
     * @param ids 需要删除的goods主键集合
     * @return 结果
     */
    public int deleteGoodsInfoByIds(Long[] ids);

    /**
     * 删除goods信息
     *
     * @param id goods主键
     * @return 结果
     */
    public int deleteGoodsInfoById(Long id);

    public GoodsInfoAndAttrValueDto selectGoodsInfoAndAttrValueById(Long id);

    /**
     * 新增goodsAndAttr
     *
     * @param goodsInfoAndAttrValueDto
     * @return 结果
     */
    public int insertGoodsInfoAndAttr(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto);

    /**
     * 修改goods
     *
     * @param goodsInfoAndAttrValueDto
     * @return 结果
     */
    @Transactional
    public int updateGoodsInfoAndAttr(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto);

    /**
     * 查询goods列表
     *
     * @param goodsInfoAndAttrValueDto
     * @return goods集合
     */
    public List<GoodsInfoAndAttrValueDto> selectGoodsInfoAndAttrList(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto);

    /**
     * 商品上架
     *
     * @param id
     * @return
     */
    public int upGoodsById(Long id);
    /**
     * 商品上架
     *
     * @param goodsInfoAndAttrValueDto
     * @return
     */
    public int upGoodsById(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto);

    /**
     * 商品下架
     *
     * @param goodsInfoAndAttrValueDto
     * @return
     */
    public int downGoodsById(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto);

    /**
     * 商品转问题
     *
     * @param goodsInfoAndAttrValueDto
     * @return
     */
    public int problemGoods(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto);

    /**
     * 商品转找回
     *
     * @param goodsInfoAndAttrValueDto
     * @return
     */
    public int retrieveGoods(GoodsInfoAndAttrValueDto goodsInfoAndAttrValueDto);

    public List<GoodsInfo> selectByResList(GoodsInfoAndAttrValueReq goodsInfoAndAttrValueReq, PageDomain pageDomain);

    public List<ExportJYMGoods> selectExportJYM(GoodsInfo goodsInfo);

    int auditGoods(Long[] ids);

    int deleteAllAccount(DeleteAllVo deleteAllVo);

    int down(Long[] ids);

    void bacthAccRetail(List<GoodsInfo> goodsInfos, List<SysUser> supplyCustomer, Long userId);
    void bacthAccRetailByUserId(List<GoodsInfo> list, List<SysUser> supplyCustomer,Long userId);

    void sensitive(GoodsInfo goodsInfo);

    int submitAccount(Long[] ids);

    List<Map<String,Object>> countForSupply(GoodsInfo goodsInfo);

    List<Map<String, Object>> userGameCount();

    int updateRemake(JSONObject params);

    int submitAccount(JSONObject params);

    int toSaled(Long id);

    int resetUnbindById(Long id);

    int toTop(Long id);

    HashMap todayDetail();

    /**
     * 转让
     */
    void transferThePossessionOf(Long transferId,Long fromUserId);


    List<GoodsInfo> selectPush(GoodReq goodReq);

    /**
     * 克隆
     * @param id
     * @return
     */
    int clone(Long id);


    /**
     * 根据手机号id  统计账号绑定信息
     * @param goodsInfo
     * @return
     */
    List<Map<String,Object>> selectGoodsGameTotal(GoodsInfo goodsInfo);
}
